export default defineEventHandler(async (event) => {
  const body = await readBody(event)
  const id: string = body.zoneConfig.origin
  const key = `first:domain:${id}`
  if (await useStorage().hasItem(key)) {
    return '400'
  }
  await useStorage().setItem(key, body)
  // const domains: Map<string, Object> = await useStorage().getItem('first:domains') || new Map()
  // if (domains.has(id)) {
  //     return 400
  // }
  // domains.set(id, { label: id, key: domains.size })
  // await useStorage().setItem('first:domains', domains)
  return 'Data is set'
})
